<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="gbk">
	<title></title>
	<link rel="stylesheet" href="bootstrap-3.3.7-dist/css/bootstrap.min.css">
	<script src="bootstrap-3.3.7-dist/js/jquery.min.js"></script>
	<script src="bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
	<script type="text/javascript">
	function applyTeam(teamid){
		var param="teamid="+teamid;
		$.ajax({
			type : 'post',
			url : 'applyTeam.do',
			data : param,
			success : function(data) {
				var data= $.trim(data);
			
			if(data=="ok"){
				alert("申请成功");
			}
			if(data=="isApplied"){
				alert("已经申请过了");
			}
			if(data=="no"){
				alert("申请失败");
			}


			},
			error : function() {
				alert("出错了！");
			}
		});


	}
	
	</script>
</head>
<style>
body {
	margin: 0px;
	background: url(style/image/background/index.jpg) no-repeat;
	background-size: 100% 100%;
	background-attachment: fixed;
}

.searchcontent{
width:600px;
margin:0 auto;
}
.ttable{
width:700px;
margin:0 auto;
}

.ttablesec{
width:700px;
margin:0 auto;
}

.pagination{

margin-left: 650px;
 	
}
</style>


<body>

<nav class="navbar navbar-default container" role="navigation"  style="border:none">
	<div class="container-fluid">
	<div class="navbar-header">
		<a class="navbar-brand" href="#">团队管理工具</a>
	</div>
	<div>
		<ul class="nav navbar-nav pull-right">
			
		    <li><a href="getTeams.do">搜索团队</a></li>
		    <li><a><img	 src="${currentUser.headimage}" width="27" height="27">
							</a></li>
			<li> <a href="#">HI!:${currentUser.userName}</a></li>
			<li><a href="logout.do">退出</a></li>
		</ul>
	</div>
	</div>
</nav>
<div class="container searchcontent">

<form id="search" action="getTeamByName.do">
				<input type="text" name="teamName" placeholder="团队名称" style="width: 500px;">&nbsp;&nbsp;<input type="submit" name="submit"/>
				</form>

</div>
</br></br></br>
    
<div class="table-responsive" Style="color:#FFFFFF;">
								<table class="ttable">
									
									<thead>
										<tr>
											<th><center><h4>团队名</h4></center></th>
											<th><center><h4>团队负责人</h4></center></th>
											<th><center><h4>创建时间</h4></center></th>
                                            <th><center></center></th>
										</tr>
									</thead>
									<c:forEach var="list" items="${list}">
									<tbody>
										<tr>
											<td><center><h4>${list.teamName}</h4></center></td>
											<td><center><h4>${list.userName}</h4></center></td>
											<td><center><h4>${list.createDate}</h4></center></td>
											<td><center>
												<a href="javascript:;" onclick="applyTeam(${list.teamId})"><font color="white"><h4>申请加入</h4></font></a>
												</center></td>
                                        </tr>
								
										
									</tbody></c:forEach>
								</table>
                              
								
                                
							</div>

								
                                
							</div>


</body>
</html>